import com.itheima.domain.User;
import org.apache.cxf.jaxrs.client.WebClient;

public class JaxRsClientDemo {
    //http://localhost:1234/userService/user/1
    public static void main(String[] args) {
        //1.创建访问服务器对象  WebClient 浏览器对象
        //WebClient client = WebClient.create("http://localhost:1234/userService/user/1");
        WebClient client = WebClient.create("http://localhost:8080/ws/userService/user/1");
        //2.设置访问的方法
        User user = client.get(User.class);//get方法是指的get请求方式，post方法指的是post请求方式
        //3.获得返回数据
        System.out.println(user);
    }
    /*public static void main(String[] args) {
        WebClient client = WebClient.create("http://localhost:8080/userService/user/");
        *//*List list = client.get(List.class);
        System.out.println(list);*//*
        *//*Collection collection = client.getCollection(User.class);
        System.out.println(collection);*//*
        List<User> list = (List<User>)client.getCollection(User.class);
        System.out.println(list);
    }*/
}
